"""

面向对象：继承的基础语法
"""


# 单继承
class Phone:
    Imei = None  # 序列号
    producer = 'ITCAST'  # 厂商

    def call_by_4g(self):
        print('4G通话')


class Phone2022(Phone):
    face_id = '10010'  # 面部识别ID

    def call_by_5g(self):
        print('2022年新功能：5G通话')


phone2022 = Phone2022()
print(phone2022.producer)
phone2022.call_by_4g()
phone2022.call_by_5g()
print('---------------------------')


# 多继承
class NFCReader:
    nfc_type = '第五代'
    producer = 'XY'

    def read_card(self):
        print('NFC读卡')

    def write_card(self):
        print('NFC写卡')


class RemoteControl:
    rc_type = '红外遥控'

    def control(self):
        print('红外遥控开启了')


class MyPhone(Phone, NFCReader, RemoteControl):
    pass


myPhone = MyPhone()
myPhone.call_by_4g()
myPhone.read_card()
myPhone.write_card()
myPhone.control()
print(myPhone.producer)

# 多继承下，父类成员名一致的场景
